package coreAuction;

import java.util.ArrayList;

public class Customer {
	private String custID;
	private String name;
	private ArrayList<Bid> bidsMade;
	
	public Customer(String c, String n) {
		custID= c;
		name = n;
		bidsMade = new ArrayList<Bid>();
	}

	public String getCustID() {
		return custID;
	}

	public void setCustID(String custID) {
		this.custID = custID;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public void addBid(Bid b) {
		bidsMade.add(b);
	}
	
	public String getReport () {
		String report = custID + "  " + String.format("%-20s",name);
		if (bidsMade.size() == 0) {
			report += "  No bids made\n";
		}
		else {
			report += "  This customer made the following bids\n";
			for (Bid b : bidsMade) {
				Item i = b.getBidItem();
				report += "   " + i.getItemID()  
				    + "   " + String.format("%-20s",i.getDescription())
				    + String.format("%6.2f", b.getBidMoney())
				    + "  " +  b.getBidState() + "\n";
			}
		}
		return report;
	}

}
